package com.cby.operation.sdk.util

import com.cby.operation.common.encrypt.Base64Utils.encode
import com.cby.operation.login.data.InternalUser

/**
 * Description:UserUtils
 *
 * @author 陈宝阳
 * @create 2020/9/1 09:20
 */
object UserUtils {

    private const val SEPARATOR = "|"

    fun getState(user: InternalUser?): String {
        if (user != null) {
            val sb = StringBuilder()
            sb.append(user.userId)
                .append(SEPARATOR)
                .append(user.loginType)
                .append(SEPARATOR)
                .append(user.token)
            return encode(sb.toString())!!
        }
        return ""
    }
}